TQuery
The type of the query.
TResult
The type of the query result.
LEADTOOLS Medical (Leadtools.Dicom.Scu assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.29
Find<TQuery,TResult>(DicomScp,TQuery,DicomMatchDelegate<TResult>) Method
See Also 
Leadtools.Dicom.Scu Namespace > QueryRetrieveScu Class > Find Method : Find<TQuery,TResult>(DicomScp,TQuery,DicomMatchDelegate<TResult>) Method




Scp
The peer connection to send the C-FIND-REQ to.
Query
The query information that describes the DICOM datasets to be found.
OnMatch
The method to call when a dataset successfully matches the query parameters.
Scp
The peer connection to send the C-FIND-REQ to.
Query
The query information that describes the DICOM datasets to be found.
OnMatch
The method to call when a dataset successfully matches the query parameters.
Sends a C-FIND-REQ message to a peer member of a connection defined by Scp. The C-FIND-REQ is defined by the Query paramter.

Syntax

Visual Basic (Declaration) 
Overloads Public Sub Find
     (Of TQuery,TResult)( _
   ByVal Scp As DicomScp, _
   ByVal Query As TQuery, _
   ByVal OnMatch As DicomMatchDelegate(Of TResult) _
) 
Visual Basic (Usage)Copy Code
Dim instance As QueryRetrieveScu
Dim Scp As DicomScp
Dim Query As TQuery
Dim OnMatch As DicomMatchDelegate(Of TResult)
 
instance.Find(Of TQuery, TResult)(Scp, Query, OnMatch)
C# 
public void Find<TQuery,TResult>( 
   DicomScp Scp,
   TQuery Query,
   DicomMatchDelegate<TResult> OnMatch
)
Managed Extensions for C++ 
public: void Find<TQuery,TResult>( 
   DicomScp* Scp,
   TQuery* Query,
   DicomMatchDelegate<TResult*>* OnMatch
) 
C++/CLI 
public:
void Findgeneric<typename TQuery>
generic<typename TResult>
( 
   DicomScp^ Scp,
   TQuery^ Query,
   DicomMatchDelegate<TResult^>^ OnMatch
) 

Parameters

Scp
The peer connection to send the C-FIND-REQ to.
Query
The query information that describes the DICOM datasets to be found.
OnMatch
The method to call when a dataset successfully matches the query parameters.

Type Parameters

TQuery
The type of the query.
TResult
The type of the query result.

Example

Finds all modality worklist items.

Visual BasicCopy Code
Public Sub FindMWL()
   DicomEngine.Startup()
   DicomNet.Startup()

   Dim query As New ModalityWorklistQuery()
   Dim scp As New DicomScp()
   Dim findMwl As New QueryRetrieveScu()

   scp.AETitle = "MWL_SERVER"
   scp.Port = 104
   scp.Timeout = 60
   scp.PeerAddress = IPAddress.Parse("192.168.0.209")
   findMwl.AETitle = "LEAD_CLIENT"
   findMwl.Find(Of ModalityWorklistQuery, ModalityWorklistResult)(scp, query, AddressOf FoundMatch)

   DicomEngine.Shutdown()
   DicomNet.Startup()
End Sub

Private Sub FoundMatch(ByVal result As ModalityWorklistResult, ByVal ds As DicomDataSet)
   Dim message As String = ((vbCr & vbLf & vbTab & "Accession #:" & vbTab & vbTab & " " & result.AccessionNumber & vbCr & vbLf & vbTab & "Patient Name:" & vbTab & vbTab) + result.PatientName.Full & vbCr & vbLf & vbTab & "Scheduled Start Date:" & vbTab) + result.ScheduledProcedureStepSequence(0).ScheduledProcedureStepStartDate.Value.ToShortDateString()

   Console.WriteLine(message)
End Sub
C#Copy Code
public void FindMWL()
{            
    DicomEngine.Startup();
    DicomNet.Startup();

    ModalityWorklistQuery query = new ModalityWorklistQuery();
    DicomScp scp = new DicomScp();
    QueryRetrieveScu findMwl = new QueryRetrieveScu();

    scp.AETitle = "MWL_SERVER";
    scp.Port = 104;
    scp.Timeout = 60;
    scp.PeerAddress = IPAddress.Parse("192.168.0.209");
    findMwl.AETitle = "LEAD_CLIENT";
    findMwl.Find<ModalityWorklistQuery, ModalityWorklistResult>(scp, query, FoundMatch);

    DicomEngine.Shutdown();
    DicomNet.Startup();
}

private void FoundMatch(ModalityWorklistResult result, DicomDataSet ds)
{
    string message =
   "\r\n\tAccession #:\t\t " + result.AccessionNumber +
   "\r\n\tPatient Name:\t\t" + result.PatientName.Full +
   "\r\n\tScheduled Start Date:\t" + result.ScheduledProcedureStepSequence[0].ScheduledProcedureStepStartDate.Value.ToShortDateString();

    Console.WriteLine(message);
}

Remarks

A DicomDataset will be created from the Query parameter. This dataset will then be send in the C-FIND-REQ. The Query class should be decorated with the correct attributes for creating the dataset.

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7

See Also

Leadtools.Dicom.Scu requires a Medical toolkit license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features